fix(pai-statusline): Linux/WSL compatibility and UX improvements#430
fix(pai-statusline): Linux/WSL compatibility and UX improvements#430fayerman-source wants to merge 3 commits intodanielmiessler:mainfrom
Conversation
Fixes several issues preventing the statusline from working on Linux/WSL:
**Bug Fixes:**
- Cross-platform `stat` command: Use `stat -c %Y` on Linux vs `stat -f %m` on macOS
- PWD fallback: Add `${current_dir:-$PWD}` when JSON input lacks directory
- Document `jq` as required dependency (was unlisted but used 20+ times)
**UX Improvements:**
- Add spacing between icons and numbers in MEMORY line (📁0 → 📁 0)
- Change "no data" indicator from `—` to `-.-` for visual consistency with
decimal format and to distinguish from error states (silent failures
previously showed `—` making bugs look like missing data)
Tested on WSL2 (Ubuntu) with Linux kernel 6.6.87.2-microsoft-standard-WSL2
Co-Authored-By: Claude Opus 4.5 <[email protected]>
CI Failure AnalysisThe ErrorRoot CauseThe
This affects all fork-based PRs to this repo - the workflow has never had a successful run. Merge RequestThe code changes in this PR have been tested and verified working on Linux/WSL:
Screenshots in PR description show before/after verification. Suggested Workflow FixesOption A: Use - name: Run Claude Code Review
uses: anthropics/claude-code-action@v1
with:
# For fork PRs, use github_token instead of OIDC
github_token: ${{ secrets.GITHUB_TOKEN }}
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}Option B: Skip CI for fork PRs jobs:
claude-review:
# Only run for PRs from the same repo
if: github.event.pull_request.head.repo.full_name == github.repositoryOption C: Manual workflow approval Analysis performed via Claude Code |
Summary
Fixes several issues preventing the
pai-statuslinepack from working correctly on Linux/WSL systems.Before / After
Bug Fixes
1. Cross-platform
statcommandThe script used macOS-only
stat -f %msyntax. Linux requiresstat -c %Y.Fix: OS detection at 3 locations:
2.
jqnot documented as dependencyThe README stated
dependencies: []but the script usesjq20+ times for JSON parsing. Withoutjq, all values silently fail to defaults.Fix: Updated README to document
jqas required dependency.3. PWD has no fallback
When JSON input lacks directory info, PWD displays empty.
Fix:
current_dir="${current_dir:-$PWD}"UX Improvements
4. Icon spacing in MEMORY line
Before:
📁0 Work │ ✦2 RatingsAfter:
📁 0 Work │ ✦ 2 Ratings5. "No data" indicator changed from
—to-.-Why: When bugs occurred (missing
jq, failingstat), the display showed—- identical to "no data available". This made debugging impossible since errors looked like missing data.-.-is:X.X)Test Environment
Test Plan
-.-shows for periods with no rating data🤖 Generated with Claude Code